package com.leyou.auth.web;

import com.leyou.auth.dto.AliOssSignatureDTO;
import com.leyou.auth.service.AliOssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/ali")
public class AliOssController {

    @Autowired
    private AliOssService aliOssService;

    /**
     * 获取上传所需要的所有参数
     *
     * @return
     */
    @GetMapping("/oss/signature")
    public ResponseEntity<AliOssSignatureDTO> getSignature() {
        return ResponseEntity.ok(this.aliOssService.getSignature());
    }
}
